<%--
 *  File:   UploadEXLMessage.jsp
 *  Author: Jamesli 
 *  Date:   2010/07/07
 *
 *  Copyright (C) 2000 - 2010 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.        
--%>

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>     
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>



<%
 	Category cat = Category.getInstance("jsp.UploadEXLMessage");  
	String privilegeCode = "Z0608,E0162,A0602";
  	String strModuleName = "SPM";
  	String contextPath = request.getContextPath();
	boolean isSucc = false;
%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/FrmDefault.inc" %>
<%@ include file="/inc/PageDefault.inc" %>
<%@ include file="/inc/LocationDefault.inc" %>
<%
	int n = 0;
	Vector totalError = new Vector();
    for(int i=1;i<=28;i++)
	{
	  if(session.getAttribute("errorcode" + i) != null)
	  {
	    if(i==21 || i==22)n=1;
		totalError.addAll((Vector)session.getAttribute("errorcode" + i));
	    session.removeAttribute("errorcode" + i);
	  }
	}
	if(totalError.size() == 0) isSucc = true;
%>
<html>
<head>
<title>UploadEXLMessage</title>
<link rel="stylesheet" href="<%=contextPath %>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath %>/js/ScriptLib.js"></script>
<script language="JavaScript">
function page_operate(operand)
{
	  if (operand=="upload")
	  {
	    cform.encoding="multipart/form-data";
	    cform.actionname.value = "upload";
	    cform.target = "_self";
	    cform.submit();
	  }
}

</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="1" cellpadding="1" border="1"> 
<%if(isSucc){%>
 <tr class="td-listrom">
  <td height="25" class="td_center"><center><b>Uploaded successfully!</b></center></td>
 </tr>
<%}else{%>
 <tr class="td-listrom">
  <td height="25" colspan="10" class="td_center"><center>Uploaded with <b><font color="red"><%= totalError.size() %></font></b> error(s)!</center></td>
 </tr>
 <tr class="td-listrom">
  <td height="20" width="20"><b>MessageId</b></td>
  <td height="20" width="200"><b>Message</b></td>
  <td height="20"><b>MessageDetail</b></td>
 </tr>
<%
	String rowclass = "";
	for(int j=0;j<totalError.size();j++){
		HashMap errorMap = (HashMap)totalError.get(j);
		if(j%2 == 1){
			rowclass = "td-listrom";
		}else{
			rowclass = "none";
		}
%>
 <tr class="<%=rowclass %>">
  <td><%= j+1 %>&nbsp</td>
  <td><font color="red"><%= message.getMessageDesc(errorMap) %>&nbsp;</font></td>
  <td><font color="red"><%= errorMap.get("messagedetail") %>&nbsp;</font></td>
 </tr>
<%	}
}%>                                    
<%totalError.clear();
    totalError.removeAllElements();
    for(int i=1;i<=28;i++)
	{
	  if(session.getAttribute("errorcode" + i) != null)
	  {
	    session.removeAttribute("errorcode" + i);
	  }
	}
%>
 <tr>
  <td class="td_center" colspan="10">
   <a onclick="page_gotourl()"><custom:button type="1" label="L_Back" imgsrc="back.gif" border="0" style="width:60"/></a>
  </td>
 </tr>
</table>
<script>
function page_gotourl(){
	if(window.location.href.split('=').length!=3){
		self.location.href='UploadEXL.jsp?<%=OvalTools.randomURL()%>';
	}else{
		self.location.href='<%=contextPath %>/tdr/datafalsify/FalsifyUploadEXL.jsp?<%=OvalTools.randomURL()%>';
	}
}
</script>
</body>
</html>


